package com.lorenzogao.pley.ui.adapter

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter
import com.lorenzogao.pley.ui.fragment.CategoryAppFragment

/**
 * 作者：Lorenzo Gao
 * Date: 2017/12/22
 * Time: 16:17
 * 邮箱：2508719070@qq.com
 * Description:
 */

class CategoryAppViewPagerAdapter(fm: FragmentManager, categoryId: Int) : FragmentStatePagerAdapter(fm) {


    private var mId: Int = categoryId

    var mTitle = arrayListOf<String>()

    init {
        mTitle.add("精品")
        mTitle.add("排品")
        mTitle.add("新品")
    }

    override fun getPageTitle(position: Int): CharSequence {
        return mTitle[position]
    }

    override fun getItem(position: Int): Fragment? {

        return CategoryAppFragment(mId, position)
    }

    override fun getCount(): Int {

        return mTitle.size
    }


}